package com.github.catvod.spider.merge;

/* loaded from: classes.dex */
public final class r {
    private static boolean V0;
    private static yh h;

    private static final class yh extends SecurityManager {
        private yh() {
        }

        @Override // java.lang.SecurityManager
        protected Class<?>[] getClassContext() {
            return super.getClassContext();
        }
    }

    private r() {
    }

    public static String BQ(String str) {
        if (str == null) {
            throw new IllegalArgumentException("null input");
        }
        try {
            return System.getProperty(str);
        } catch (SecurityException unused) {
            return null;
        }
    }

    private static yh I() {
        try {
            return new yh();
        } catch (SecurityException unused) {
            return null;
        }
    }

    private static yh V0() {
        yh yhVar = h;
        if (yhVar != null) {
            return yhVar;
        }
        if (V0) {
            return null;
        }
        yh I = I();
        h = I;
        V0 = true;
        return I;
    }

    public static Class<?> h() {
        int i;
        yh V02 = V0();
        if (V02 == null) {
            return null;
        }
        Class<?>[] classContext = V02.getClassContext();
        String name = r.class.getName();
        int i2 = 0;
        while (i2 < classContext.length && !name.equals(classContext[i2].getName())) {
            i2++;
        }
        if (i2 >= classContext.length || (i = i2 + 2) >= classContext.length) {
            throw new IllegalStateException("Failed to find org.slf4j.helpers.Util or its caller in the stack; this should not happen");
        }
        return classContext[i];
    }

    public static final void j(String str) {
        System.err.println("SLF4J: " + str);
    }

    public static boolean oC(String str) {
        String BQ = BQ(str);
        if (BQ == null) {
            return false;
        }
        return BQ.equalsIgnoreCase("true");
    }

    public static final void q(String str, Throwable th) {
        System.err.println(str);
        System.err.println("Reported exception:");
        th.printStackTrace();
    }
}
